import { createProps, createCellRender } from "./common";
import { h } from "vue";
import XEUtils from "xe-utils";
import { getDatePickerCellValue } from "./ElDatePicker";
import dictTag from "@/components/DictTag/index.vue";
export default {
    renderCell(renderOpts: any, params: any) {
        const { row, column } = params;
        const { attrs } = renderOpts;
        const cellValue = XEUtils.get(row, column.field as string);
        return [
            h(dictTag, {
                ...attrs,
                ...createProps(renderOpts, cellValue, {}),
                renderOpts,
                params,
                row,
                column,
                ...renderOpts.attrs,
                value: row[column.property],
            }),
        ];
    },
    renderDefault(renderOpts: any, params: any) {
        const { row, column } = params;
        const { attrs } = renderOpts;
        const cellValue = XEUtils.get(row, column.field as string);
        return [
            h(dictTag, {
                ...attrs,
                ...createProps(renderOpts, cellValue, {}),
                renderOpts,
                params,
                row,
                column,
                ...renderOpts.attrs,
                value: row[column.property],
            }),
        ];
    },
};
